package com.bds.btcdc.web.model.record;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: kevin
 * @date: 2018/5/8
 * @description:
 */
@Table("t_order_record")
public class OrderRecord implements Serializable {

    @Id
    private long id;

    @Column
    private long user_id;

    @Column
    private String exchange;

    @Column
    private String symbol;

    @Column
    private Double num;

    @Column
    private Double price;

    @Column
    private int status;

    @Column
    private Date create_time;

    @Column
    private Date cancel_time;

    @Column
    private Date finish_time;
    @Column
    private String order_no;
    @Column
    private String api_id;
    @Column
    private String type;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getUser_id() {
        return user_id;
    }

    public void setUser_id(long user_id) {
        this.user_id = user_id;
    }

    public String getExchange() {
        return exchange;
    }

    public void setExchange(String exchange) {
        this.exchange = exchange;
    }

    public String getSymbol() {
        return symbol;
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    public Double getNum() {
        return num;
    }

    public void setNum(Double num) {
        this.num = num;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public Date getCancel_time() {
        return cancel_time;
    }

    public void setCancel_time(Date cancel_time) {
        this.cancel_time = cancel_time;
    }

    public Date getFinish_time() {
        return finish_time;
    }

    public void setFinish_time(Date finish_time) {
        this.finish_time = finish_time;
    }

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    public String getApi_id() {
        return api_id;
    }

    public void setApi_id(String api_id) {
        this.api_id = api_id;
    }


    public OrderRecord(){

    }

    public OrderRecord(String exchange, String api_id) {
        this.exchange = exchange;
        this.api_id = api_id;
    }

    @Override
    public boolean equals(Object obj) {
        OrderRecord record=(OrderRecord)obj;
        if(record.getApi_id().equals(this.api_id)&&record.getExchange().equals(this.exchange)){
            return true;
        }else {
            return false;
        }
    }
}
